\chapter{Conclusion and Future Work}

Retargeting compilers to a new architecture is a challenging job. But we can make this process simpler by using information from
existing architectures. Through empirical studies we were able to show the similarities between architectures which is in line with Davidson and 
Fraser's observation\cite{Davidson}.

As part of our work, we have implemented a parser to read MD files. We chose to concentrate on RTL templates in MD files, which are used to build 
expander, describe instructions, instruction scheduling, peephole optimization, etc. We devised a method to extract RTL patterns from the RTL 
templates. With this framework in hand, we measured similarities between machine description files based on their
RTL patterns and showed that similarities that exist are promising. We also proposed that the RTL patterns 
which are common between machines can be grouped and we can come up with a minimal set of RTL patterns which can be used in building
machine description files for new machines of similar class. These RTL patterns can be filled with the new machine's parameters to generate 
parts of the machine description file for the new machine. As part of that, we showed how to instantiate a RTL pattern with parameters to 
get the RTL template. We also
found that this technique can be used to remove redundancies within machine description files of a particular machine by listing 
RTL patterns separately and instantiating them with parameters.

One of the immediate future works is to create a Graphical User Interface(GUI) that can help the user to visualize RTL patterns and fill it.
The long term goal of this work is to build a tool which can automatically generate parts of MD files from existing MD files with user assistance. While it seems
impossible to generate a complete MD file automatically, even a partially generated MD file will help the user in retargeting.